home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / TPL60N14.ARJ / BUG87.PAS < prev    next >
Pascal/Delphi Source File  |  1992-05-01  |  711b  |  25 lines

  1. PROGRAM BUG87;        { demonstrates some strange behavior on 8087/287 }
  2.  
  3. {$A+,B+,D+,E-,F-,G-,I+,L+,N+,O-,R+,S+,V+,X-}
  4. {$M 16384,0,655360}
  5.  
  6.  
  7. VAR X: EXTENDED;      { allows storing of denormal }
  8.     L: WORD;
  9.  
  10. BEGIN
  11.   WriteLn ('Turbo-Pascal 6.0 floating point exception bug demo program');
  12.   WriteLn;
  13.   WriteLn ('Continously dividing 4e-4932 by 1.1...');
  14.   WriteLn;
  15.   X := 4e-4932;       { close to smallest normalized EXTENDED number }
  16.   FOR L := 1 TO 5 DO BEGIN
  17.      X := X / 1.1;
  18.      Write (X:25);
  19.      IF L > 1 THEN    { after 1st iter. underflow w/ flush to zero }
  20.         WriteLn ('   should be: ', 0.0:25)
  21.      ELSE
  22.         WriteLn ('   should be: ', X:25);
  23.   END;
  24. END. { BUG87 }
  25.